<template>
    <div>
        <el-row class="tac">
            <el-col>
                <el-menu
                        router
                        default-active="2"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose">
                    <!--                    <el-submenu-->
                    <!--                            v-for="(item,index) in menuList"-->
                    <!--                            :key="index"-->
                    <!--                            :index="index+''"-->
                    <!--                    >-->
                    <!--                        <template slot="title">-->
                    <!--                            <i class="el-icon-menu"></i>-->
                    <!--                            <span>{{item.nameZh}}</span>-->
                    <!--                        </template>-->
                    <!--                        <el-menu-item-group>-->
                    <!--                            <el-menu-item index="/android">安卓</el-menu-item>-->
                    <!--                            <el-menu-item index="/iphone">苹果</el-menu-item>-->
                    <!--                        </el-menu-item-group>-->
                    <!--                    </el-submenu>-->
                    <el-menu-item v-for="(item,index) in menuList"
                                  :key="item.path"
                                  :index="item.path">
                        <i class="el-icon-menu"></i>
                        <span slot="title">{{item.nameZh}}</span>
                    </el-menu-item>

                </el-menu>
            </el-col>
        </el-row>
    </div>
</template>

<script>
    import {SELECT_USER_MENU} from "@/api/system/"

    export default {
        name: "Header-Background-Management",
        data() {
            return {
                menuList: [
                    // {nameZh:"test",path:"/car"},
                    // {nameZh:"test2",path:"/car1"}
                ],
            }
        },
        created() {
            let username = sessionStorage.getItem("username")
            SELECT_USER_MENU({username}).then(res => {
                this.menuList = res.data.data
            })
        },
        methods: {
            handleOpen(key, keyPath) {

            },
            handleClose(key, keyPath) {

            }
        }
    }
</script>

<style scoped>

</style>